//
//  MovieDetail.m
//  UI豆瓣2
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "MovieDetail.h"

@implementation MovieDetail

- (void)dealloc
{
    [_imageView release];
    [_ratingLabel release];
    [_rating_countLabel release];
    [_dataLabel release];
    [_runtimeLabel release];
    [_genresLabel release];
    [_countryLabel release];
    [_plotLabel release];
    [_actorsLabel release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createMovieDetail];
    }
    return self;
}

- (void)createMovieDetail{
    
    self.backgroundColor = [UIColor whiteColor];
    
    self.movieFavorite = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
    self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(30, 30, 120, 175)];
    self.imageView.image = [UIImage imageNamed:@"picholder.png"];
    [self.movieFavorite addSubview:self.imageView];
    [_imageView release];
    
    //评分
    self.ratingLabel = [[UILabel alloc] initWithFrame:CGRectMake(170, 30, 80, 25)];
    self.ratingLabel.font = [UIFont systemFontOfSize:17];
    [self.movieFavorite addSubview:self.ratingLabel];
    [_ratingLabel release];
    
    //评论数
    self.rating_countLabel = [[UILabel alloc] initWithFrame:CGRectMake(270, 30, 100, 25)];
    self.rating_countLabel.font = [UIFont systemFontOfSize:17];
    [self.movieFavorite addSubview:self.rating_countLabel];
    [_rating_countLabel release];
    
    
    self.dataLabel = [[UILabel alloc] initWithFrame:CGRectMake(170, 65, 100, 25)];  //日期
    self.runtimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(170, 100, 100, 25)];  //时长
    self.genresLabel = [[UILabel alloc] initWithFrame:CGRectMake(170, 135, 150, 25)];  //类型
    self.countryLabel = [[UILabel alloc] initWithFrame:CGRectMake(170, 170, 100, 25)];  //国家
    NSMutableArray *arr = [NSMutableArray arrayWithObjects:self.dataLabel, self.runtimeLabel, self.genresLabel, self.countryLabel, nil];
    for (int i = 0; i < arr.count; i++) {
        UILabel *temp = [arr objectAtIndex:i];
        temp.font = [UIFont systemFontOfSize:17];
        [self.movieFavorite addSubview:temp];
    }
    [_dataLabel release];
    [_runtimeLabel release];
    [_genresLabel release];
    [_countryLabel release];
    
    
    UILabel *actLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 230, 100, 25)];
    actLabel.text = @"制作人";
    actLabel.font = [UIFont boldSystemFontOfSize:22];
    [self.movieFavorite addSubview:actLabel];
    [actLabel release];
    
    //制作人详情
    self.actorsLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 260, 320, 75)];
    self.actorsLabel.font = [UIFont systemFontOfSize:17];
    self.actorsLabel.numberOfLines = 0;
    self.actorsLabel.lineBreakMode = NSLineBreakByWordWrapping;
    [self.movieFavorite addSubview:self.actorsLabel];
    [_actorsLabel release];
    
    
    UILabel *plLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 350, 100, 25)];
    plLabel.text = @"电影情节";
    //plLabel.font = [UIFont systemFontOfSize:22];
    plLabel.font = [UIFont boldSystemFontOfSize:22];
    [self.movieFavorite addSubview:plLabel];
    [plLabel release];
    
    //电影简介
    self.plotLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 400, 320, 200)];
    self.plotLabel.font = [UIFont systemFontOfSize:17];
    self.plotLabel.numberOfLines = 0;
    self.plotLabel.lineBreakMode = NSLineBreakByWordWrapping;
    [self.movieFavorite addSubview:self.plotLabel];
    [_plotLabel release];
    
    [self addSubview:self.movieFavorite];
}





@end
